﻿using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DefCore.Cameras;
using Krypton;
using Microsoft.Xna.Framework.Graphics;
using FarseerPhysics.Dynamics;
using FarseerPhysics.DebugViews; 

namespace DefCore
{
    public static class Globals
    {
        public static string Version { get { return "0.5.131<LOCAL::24.08.13> SKIN_7  "; } }

        private static readonly int GLOBAL_TILE_WIDTH = 184;
        private static readonly int GLOBAL_TILE_HEIGHT = 184;

        public static float AmbientLevel = .14f;

        public static bool EnableKryptonDebugDrawing = false;
        public static bool EnableFarseerDebugDrawing = false;

        public static Vector2 TileSize
        {
            get { return Camera.SizeWithZoom(new Vector2(Globals.GLOBAL_TILE_WIDTH, Globals.GLOBAL_TILE_HEIGHT)); }
        }
        public static readonly Point[] Directions = { new Point(0, -1), new Point(1, 0), new Point(0, 1), new Point(-1, 0)};
        
        public static int RandomInt(int min, int max)
        {
            return Objects.RandomGen.Next(min, max);
        }
        public static double RandomDouble(double min, double max)
        {
            return Objects.RandomGen.NextDouble() * (max -  min) + min;
        }
    }

    public static class Objects
    {
        public static Game GameObject { get; set; }
        public static World GameWorld { get; set; }
        public static Camera GameCamera { get; set; }
        public static KryptonEngine KryptonEngine { get; set; }
        public static DebugViewXNA FarseerDebugView { get; set; }
        public static LevelBase LevelInstance { get; set; }

        /* Singletons */
        private static Random _RandomGen;
        public static Random RandomGen
        {
            get
            {
                if (_RandomGen == null)
                    _RandomGen = new Random();

                return _RandomGen;
            }
        }
    }
}
